package com.qf.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.qf.mapper.DtsRoleMapper;
import com.qf.pojo.DtsRole;
import com.qf.service.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashSet;
import java.util.List;
import java.util.Set;

/*
 *@Description:
 *@author:刘哥
 *@Date:21:19 2022/7/25
 */
@Service
public class RoleServiceImpl implements RoleService {
    @Autowired
    DtsRoleMapper roleMapper;
    @Override
    public Set<String> queryRoles(Integer[] roleIds) {
        QueryWrapper<DtsRole> queryWrapper=new QueryWrapper<>();
        queryWrapper.in("id",roleIds);
        List<DtsRole> Roles = roleMapper.selectList(queryWrapper);
        Set<String> roleSet=new HashSet<>();
        if (Roles != null) {
            for (DtsRole role : Roles) {
                roleSet.add(role.getName());
            }
        }
        return roleSet;
    }
}
